# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=xdg-desktop-portal-lxqt
pkgver=0.5.0
pkgrel=0
pkgdesc="LXQT xdg desktop portal"
url="https://github.com/lxqt/xdg-desktop-portal-lxqt"
arch="all !armhf" # kwindowsystem
license="LGPL-2.1-or-later"
depends="
	xdg-desktop-portal
	"
makedepends="
	cmake
	kwindowsystem5-dev
	libfm-qt-dev
	qt5-qtbase-dev
	samurai
	xdg-desktop-portal-dev
	"
source="https://github.com/lxqt/xdg-desktop-portal-lxqt/releases/download/$pkgver/xdg-desktop-portal-lxqt-$pkgver.tar.xz"
options="!check" # no tests

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt/translations/$pkgname
}

sha512sums="
3f1a0de1fcc577b14b69c98b715f627dc636edc8663786374627196873a6e123aab2b6051bd86416729eb6e101ec0625051716b981a3fc4d7b5c7ddcd46ceae8  xdg-desktop-portal-lxqt-0.5.0.tar.xz
"
